package zut.cs.liziflower.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import zut.cs.liziflower.entity.Comments;
import zut.cs.liziflower.mapper.CommentsMapper;
import zut.cs.liziflower.service.ICommentsService;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author xuwenke
 * @since 2022-05-19
 */
@Service
@Transactional
public class CommentsServiceImpl extends ServiceImpl<CommentsMapper, Comments> implements ICommentsService {

    @Resource
    private CommentsMapper commentsMapper;

    @Override
    public List<Comments> getCommentByUserIdAndFlowerId(Integer userid, Integer flowerid) {
        List<Comments> list = commentsMapper.getCommentByUserIdAndFlowerId(userid, flowerid);
        return list;
    }

    @Override
    public List<Comments> getComment(Integer flowerid) {
        List list = commentsMapper.getComment(flowerid);
        return list;
    }

    @Override
    public int addRemark(Integer userid, Integer flowerid, String remark) {
        return commentsMapper.addRemark(userid, flowerid, remark);
    }
}
